<?php
function qr_gen($data, $size='150x150', $gap = 4, $intol='L', $encode='UTF-8'){
  // Create some random text-encoded data for a line chart.
  header('content-type: image/png');
  $url = 'http://chart.apis.google.com/chart';

  // Add data, chart type, chart size, and scale to params.
  $chart = array(
    'cht' => 'qr',
    'chs' => $size,
	'chl' => $data,
	'chld' => $intol,
	'choe' => $encode);

  // Send the request, and print out the returned bytes.
  $context = stream_context_create(
    array('http' => array(
      'method' => 'POST',
      'content' => http_build_query($chart))));
  fopen($url, 'r', false, $context);
?>